# Contributor: Jonah Brüchert <jbb@kaidan.im>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=angelfish
pkgver=23.08.4
pkgrel=0
pkgdesc="Small Webbrowser for Plasma Mobile"
# armhf blocked by extra-cmake-modules
# ppc64le and s390x blocked by qt5-qtwebengine
# riscv64 disabled due to missing rust in recursive dependency
arch="all !ppc64le !s390x !armhf !riscv64"
url="https://phabricator.kde.org/source/plasma-angelfish/"
license="GPL-3.0-or-later"
depends="
	kirigami-addons
	kirigami2
	plasma-framework5
	purpose5
	qt5-qtbase-sqlite
	qt5-qtfeedback
	qt5-qtquickcontrols2
	"
makedepends="
	corrosion
	extra-cmake-modules
	futuresql-dev
	kdeclarative5-dev
	ki18n5-dev
	kio5-dev
	kirigami-addons-dev
	kirigami2-dev
	plasma-framework5-dev
	purpose5-dev
	qqc2-desktop-style5-dev
	qt5-qtfeedback-dev
	qt5-qtwebengine-dev
	samurai
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/network/angelfish.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/angelfish-$pkgver.tar.xz"
options="net" # net required to download Rust dependencies

provides="plasma-angelfish=$pkgver-r$pkgrel" # Backwards compatibility
replaces="plasma-angelfish" # Backwards compatibility

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -j1
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
5852e22536604176481675e898b445a49718e1cda6fd4a9dc5cfcc4159bf9d00c9e3adf98495e3ecca0f973412e9e8c8dfaf0be37b5ce18cff256ace27f0d858  angelfish-23.08.4.tar.xz
"
